﻿<Window
	x:Class="ICSharpCode.PackageManagement.SelectProjectsView"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:core="http://icsharpcode.net/sharpdevelop/core"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:pm="clr-namespace:ICSharpCode.PackageManagement"
	xmlns:pmd="clr-namespace:ICSharpCode.PackageManagement.Design"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	mc:Ignorable="d"
	WindowStartupLocation="CenterOwner"
 	Style="{x:Static core:GlobalStyles.DialogWindowStyle}"
	Title="Select Projects"
	Height="300"
	Width="480"
	MinHeight="300"
	MinWidth="300">
	
	<Window.Resources>	
		<Style TargetType="Button" BasedOn="{x:Static core:GlobalStyles.ButtonStyle}"/>
		<DataTemplate x:Key="ListBoxItemTemplate">
			<Grid>
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="Auto"/>
					<ColumnDefinition />
				</Grid.ColumnDefinitions>
				
				<CheckBox
					Margin="4, 2"
					IsEnabled="{Binding IsEnabled, Mode=OneWay}"
					IsChecked="{Binding IsSelected}"
					Content="{Binding Name}"/>
			</Grid>
		</DataTemplate>
	</Window.Resources>
	
	<Grid
		d:DataContext="{d:DesignInstance pmd:DesignTimeSelectProjectsViewModel, IsDesignTimeCreatable=True}">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition />
			<RowDefinition Height="Auto"/>
		</Grid.RowDefinitions>
	
		<TextBlock
			Grid.Row="0"
			Margin="4"
			Text="Install the package into the following projects:"/>
		<ListBox
			Grid.Row="1"
			ItemTemplate="{StaticResource ListBoxItemTemplate}"
			ItemsSource="{Binding Path=Projects}"/>
		<StackPanel 
			Grid.Row="2"
			Margin="4"
			Orientation="Horizontal"
			HorizontalAlignment="Right">
			<Button 
				Content="_OK" 
				Click="AcceptButtonClick"/>
			<Button 
				Content="_Cancel"
				IsCancel="True"/>
		</StackPanel>
	</Grid>
</Window>